package com.wm.dao;

import java.util.List;

import com.wm.bean.Area;
import com.wm.bean.Order;
import com.wm.bean.Orders;

/**
 * 订单
 * @author yangbo
 *
 * 2012-12-26
 */
public interface OrdersDAO {

	/**
	 * 保存Orders对象
	 * 
	 * @param orders
	 * 			Orders
	 * @return Orders
	 * 			Orders
	 */
	public Orders saveOrders(Orders orders);
	
	/**
	 * 更新Orders对象
	 * 
	 * @param orders
	 * 			Orders
	 * @return Orders
	 * 			Orders
	 */
	public Orders updateOrders(Orders orders);
	
	/**
	 * 根据ID删除Orders对象
	 * 
	 * @param id
	 * 			long
	 */
	public void removeOrdersById(long id);
	
	/**
	 * 根据ID获取Orders对象
	 * 
	 * @param id
	 * 			long
	 * @return Orders
	 * 			Orders
	 */
	public Orders findOrdersByid(long id);
	
	/**
	 * 获取Orders对象列表
	 * @param state
	 * @param orderby
	 * @param ascOrDesc
	 * @param firstResult
	 * @param maxResults
	 * @return List
	 * 			List
	 */
	public List findOrdersByState(int state,String orderby,int ascOrDesc,int firstResult,int maxResults);
	
	/**
	 * 获取Orders对象个数
	 * @param state
	 * @return long
	 * 			long
	 */
	public long getOrderNumByState(int state);
	
	/**
	 * 根据userId,findType查询记录
	 * @param userId
	 * @param findType
	 * @param orderby
	 * @param ascOrDesc
	 * @param firstResult
	 * @param maxResults
	 * @return
	 */
	public List findOrdersByUserIdFindType(long userId,int findType,String orderby,int ascOrDesc,int firstResult,int maxResults);
	
	/**
	 * 根据userId,findType查询记录获取Orders对象个数
	 * @param userId
	 * @param findType
	 * @return
	 */
	public long getOrderNumByUserIdFindType(long userId,int findType);
	
	/**
	 * 根据条件查询记录
	 * @param userId
	 * @param state
	 * @return
	 */
	public Orders findOrdersByUserIdState(long userId,int state);
	
	/**
	 * 根据resId,time查询记录
	 * @param resId
	 * @param time
	 * @param orderby
	 * @param ascOrDesc
	 * @param firstResult
	 * @param maxResults
	 * @return
	 */
	public List findOrdersByResIdTime(long resId,int time,String orderby,int ascOrDesc,int firstResult,int maxResults);
	
	/**
	 * 根据根据resId,time查询记录获取Orders对象个数
	 * @param resId
	 * @param time
	 * @return
	 */
	public long getOrderNumByResIdTime(long resId,int time);
}
